﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Reactive.Subjects;
using System.Text;
using System.Threading.Tasks;

namespace FinScreen
{
    class Observable<T> : IObservable<T> where T:class
    {
        private Subject<T> _subject = new Subject<T>();

        protected Observable()
        {
        }

        public IDisposable Subscribe(IObserver<T> observer)
        {
            return _subject.Subscribe(observer);
        }

        protected void OnNext(T obj)
        {
            _subject.OnNext(obj);
        }

        protected void OnComplete()
        {
            _subject.OnCompleted();
        }
    }
}
